//
//  EventsListViewController.h
//  StanfordEvents
//
//  Created by Gongmyung on 6/30/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import "Event.h"
#import "PublishEventTableViewController.h"
#import "EventDetailTableViewController.h"


@interface EventsListViewController : UITableViewController <CLLocationManagerDelegate, PublishEventTableViewDelegate, EventDetailViewDelegate> {
    NSMutableArray *eventsArray;
    NSManagedObjectContext *managedObjectContext;
    
    CLLocationManager *locationManager;
    UIBarButtonItem *addButton;
    
    bool needsUpdate;
}

- (id)initWithStyle:(UITableViewStyle)style withEvents:(NSMutableArray *)events;

- (void) addEvent;

//gets called when we check in an event (in case event is not in the my events list, we add it)
- (void) addEventToList:(Event *)toAdd;

//gets called when the publisheventviewcontroller finishes creating an event
- (void)PublishEventViewControllerDidFinish:(Event *)toPublish;

- (void)updateFilters;

@property (nonatomic, retain) NSMutableArray *eventsArray;
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, retain) UIBarButtonItem *addButton;
@property (nonatomic, assign) bool needsUpdate;

@end
